﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DeployGames.TweenEngine.equations
{
    public abstract class Quint : TweenEquation
    {
        public static QuintIN IN = new QuintIN();
        public static QuintOUT OUT = new QuintOUT();
        public static QuintINOUT INOUT = new QuintINOUT();

        #region QuintIN
        public class QuintIN : Quint
        {

            public override float compute(float t)
            {
                return t * t * t * t * t;
            }

            public override string ToString()
            {
                return "Quint.IN";
            }
        }
        #endregion

        #region QuintOUT
        public class QuintOUT : Quint
        {

            public override float compute(float t)
            {
                return (t -= 1) * t * t * t * t + 1;
            }

            public override string ToString()
            {
                return "Quint.OUT";
            }
        }
        #endregion

        #region QuintINOUT
        public class QuintINOUT : Quint
        {
            public override float compute(float t)
            {
                if ((t *= 2) < 1) return 0.5f * t * t * t * t * t;
                return 0.5f * ((t -= 2) * t * t * t * t + 2);
            }

            public override string ToString()
            {
                return "Quint.INOUT";
            }
        }
        #endregion
    }
}
